package zheng.mockit.plugin.http.message;

import zheng.mockit.utils.JacksonUtils;

/**
 * Created by zcz on 16-7-29.
 */
public class MockitHttpResponseMessage {
    private int statusCode;
    private String content;

    public int getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(int statusCode) {
        this.statusCode = statusCode;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MockitHttpResponseMessage that = (MockitHttpResponseMessage) o;

        if (statusCode != that.statusCode) return false;
        if (content != null ? !content.equals(that.content) : that.content != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = statusCode;
        result = 31 * result + (content != null ? content.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return JacksonUtils.toJson(this);
    }
}
